
import { defineStore } from "pinia"
import { ref, computed, reactive } from "vue"


const useTodoStore = defineStore("todo", () => {

  // state
  let todoList = reactive([
    {
      id: "01",
      text: "学习vue3",
      done: true,
      isEdit: false,
    },
    {
      id: "02",
      text: "学习react",
      done: false,
      isEdit: false,
    },
  ]);

  // mutations
  const del = (idx) => todoList.splice(idx, 1)


  return {
    todoList, del
  }
})

export default useTodoStore;